////////////////////////////////////////////////////////////////////////////////
//
//  Copyright (c) 2010 Leon Coto Rodriguez
//  leoncoto@gmail.com
//  
//  Permission is hereby granted, free of charge, to any person
//  obtaining a copy of this software and associated documentation
//  files (the "Software"), to deal in the Software without
//  restriction, including without limitation the rights to use,
//  copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following
//  conditions:
//  
//   The above copyright notice and this permission notice shall be
//   included in all copies or substantial portions of the Software.
//  
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//  OTHER DEALINGS IN THE SOFTWARE.
//
////////////////////////////////////////////////////////////////////////////////
package org.flexspeedup.model
{
[Bindable]
/**
 * Implmenenting this interface means that a class can be used as a ResultSet in
 * a collection service request/response
 */
public interface IResultSet
{
    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------------
    // firstPage
    //--------------------------------
    /**
     * The first page in the remote data collection
     */
    function get firstPage():int;
    function set firstPage(value:int):void; 

    //--------------------------------
    // currentPage
    //--------------------------------
    /**
     * The current page in the remote data collection represented by this 
     * ResultSet object  
     */
    function get currentPage():int;
    function set currentPage(value:int):void;

    //--------------------------------
    // nextPage
    //--------------------------------
    /**
     * The next page in the remote data collection, relative to the 
     * <code>currentPage</code> and the <code>itemCountPerPage</code> in this 
     * ResultSet object.
     */
    function get nextPage():int;
    function set nextPage(value:int):void;  

    //--------------------------------
    // lastPage
    //--------------------------------
    /**
     * The last page in the remote data collection. 
     */
    function get lastPage():int;
    function set lastPage(value:int):void; 

    //--------------------------------
    // previousPage
    //--------------------------------
    /**
     * The previous page in the remote data collection, relative to the 
     * <code>currentPage</code> and the <code>itemCountPerPage</code> in this 
     * ResultSet object.
     */
    function get previousPage():int;
    function set previousPage(value:int):void;
    
    //--------------------------------
    // itemCountPerPage
    //--------------------------------
    /**
     * The total items to be fetched from the remote data collection in this 
     * ResultSet object.
     */
    function get itemCountPerPage():int;
    function set itemCountPerPage(value:int):void;

    //--------------------------------
    // items
    //--------------------------------
    /**
     * The actual items contained in this ResultSet object. 
     */
    function get items():Array;
    function set items(value:Array):void;

    //--------------------------------
    // totalItemCount
    //--------------------------------
    /**
     * The total of items in the remote data collection.
     */
    function get totalItemCount():int;
    function set totalItemCount(value:int):void;

    //--------------------------------
    // pageCount
    //--------------------------------
    /**
     * The total item pages in the remote data collection, relative to 
     * <code>itemCountPerPage</code>.
     */
    function get pageCount():int;
    function set pageCount(value:int):void;
    
    //--------------------------------
    // hasNextPage
    //--------------------------------
    /**
     * True if has next page
     */
    function get hasNextPage():Boolean;
    function set hasNextPage(value:Boolean):void;
    
    //--------------------------------
    // hasPreviousPage
    //--------------------------------
    /**
     * True if has previous page
     */
    function get hasPreviousPage():Boolean;
    function set hasPreviousPage(value:Boolean):void;
}
}